import { postLogin } from '@/services';
const state = {
    userInfo:{}
}

const mutations = {
    userInfor(state,payload){
        state.userInfo = payload
    }
}
const actions = {
    PostLogin({commit},payload){
        postLogin(payload).then(res=>{
            localStorage.setItem('user',JSON.stringify(res))
            commit("userInfor",res)
        })
    }
}

export default {
    namespaced: true,
    state,
    mutations,
    actions,
}